Some software code, in particular older software code, is written for use in single threaded processing systems. Development tools, such as compilers and testing systems exist for use in the conversion of single threaded software for use in multithreaded processing environments. The converted code is commonly referred to as threadsafe code and the conversion process is referred to as a threadsafe conversion process. The threadsafe conversion process is arranged to ensure that variables that are common or shared between multiple threads in the multithreaded processing environments are shared safely, that is, ensuring that changes are made to the variable are made in a controlled way. Such conversion of the original code to threadsafe code typically involves applying locking mechanisms to the sections of code that modify the shared variables. This is commonly achieved by recasting the shared variables as objects. The statements that operate on those variables may also be recast as methods that operate on the corresponding recast objects. The methods may then be used to obtain an appropriate lock prior to using the corresponding variable.
One problem with the above arrangement is that locking mechanisms incur a significant processing overhead. Therefore, some restructuring of the code is commonly performed to reduce the number of locking mechanisms required. However, when changes are made to the original code that affects a shared variable, a new version of the threadsafe code must be produced. Producing a new version of the code requires significant amounts of engineering and processing resources and is prone to errors being introduced to the software.